package com.ruoyi.thgd.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.thgd.mapper.ThgdLdcJcsjPhMapper;
import com.ruoyi.thgd.domain.ThgdLdcJcsjPh;
import com.ruoyi.thgd.service.IThgdLdcJcsjPhService;

/**
 * 流动车-监测1 - phService业务层处理
 *
 * @author chenhs
 * @date 2024-09-28
 */
@Service
public class ThgdLdcJcsjPhServiceImpl implements IThgdLdcJcsjPhService
{
    @Autowired
    private ThgdLdcJcsjPhMapper thgdLdcJcsjPhMapper;

    /**
     * 查询流动车-监测1 - ph
     *
     * @param id 流动车-监测1 - ph主键
     * @return 流动车-监测1 - ph
     */
    @Override
    public ThgdLdcJcsjPh selectThgdLdcJcsjPhById(Long id)
    {
        return thgdLdcJcsjPhMapper.selectThgdLdcJcsjPhById(id);
    }

    /**
     * 查询流动车-监测1 - ph列表
     *
     * @param thgdLdcJcsjPh 流动车-监测1 - ph
     * @return 流动车-监测1 - ph
     */
    @Override
    public List<ThgdLdcJcsjPh> selectThgdLdcJcsjPhList(ThgdLdcJcsjPh thgdLdcJcsjPh)
    {
        return thgdLdcJcsjPhMapper.selectThgdLdcJcsjPhList(thgdLdcJcsjPh);
    }

    /**
     * 新增流动车-监测1 - ph
     *
     * @param thgdLdcJcsjPh 流动车-监测1 - ph
     * @return 结果
     */
    @Override
    public int insertThgdLdcJcsjPh(ThgdLdcJcsjPh thgdLdcJcsjPh)
    {
        thgdLdcJcsjPh.setId(IdUtil.getSnowflakeNextId());
        thgdLdcJcsjPh.setCreateTime(DateUtils.getNowDate());
        return thgdLdcJcsjPhMapper.insertThgdLdcJcsjPh(thgdLdcJcsjPh);
    }

    /**
     * 修改流动车-监测1 - ph
     *
     * @param thgdLdcJcsjPh 流动车-监测1 - ph
     * @return 结果
     */
    @Override
    public int updateThgdLdcJcsjPh(ThgdLdcJcsjPh thgdLdcJcsjPh)
    {
        thgdLdcJcsjPh.setUpdateTime(DateUtils.getNowDate());
        return thgdLdcJcsjPhMapper.updateThgdLdcJcsjPh(thgdLdcJcsjPh);
    }

    /**
     * 批量删除流动车-监测1 - ph
     *
     * @param ids 需要删除的流动车-监测1 - ph主键
     * @return 结果
     */
    @Override
    public int deleteThgdLdcJcsjPhByIds(Long[] ids)
    {
        return thgdLdcJcsjPhMapper.deleteThgdLdcJcsjPhByIds(ids);
    }

    /**
     * 删除流动车-监测1 - ph信息
     *
     * @param id 流动车-监测1 - ph主键
     * @return 结果
     */
    @Override
    public int deleteThgdLdcJcsjPhById(Long id)
    {
        return thgdLdcJcsjPhMapper.deleteThgdLdcJcsjPhById(id);
    }
}
